Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArC: detect incorrect usage of javax.inject.Singleton #37648

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

mkouba
Copy link
Contributor

@mkouba mkouba commented Dec 11, 2023

  • jakarta.inject.Singleton should be used instead

@mkouba mkouba requested a review from manovotn December 11, 2023 09:04
@quarkus-bot quarkus-bot bot added the area/arc Issue related to ARC (dependency injection) label Dec 11, 2023
@@ -44,6 +44,7 @@ void detect(ArcConfig config, ApplicationIndexBuildItem applicationIndex, Custom
unsupported.add(new UnsupportedAnnotation("com.google.inject.Singleton", correctSingleton));
unsupported.add(new UnsupportedAnnotation("jakarta.ejb.Singleton", correctSingleton));
unsupported.add(new UnsupportedAnnotation("groovy.lang.Singleton", correctSingleton));
unsupported.add(new UnsupportedAnnotation("javax.inject.Singleton", correctSingleton));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we handle @ApplicationScoped and friends somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, but it's not very common that the javax.enterprise:cdi-api is on the classpath, unlike javax.inject...

import jakarta.enterprise.event.Observes;
import jakarta.inject.Singleton;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cescoffier To be honest - I don't understand what is the MyObserver used for?

@mkouba mkouba added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Dec 11, 2023

This comment has been minimized.

@gsmet gsmet force-pushed the detect-javax-singleton branch from e27689a to d1b359d Compare December 11, 2023 13:34
@gsmet
Copy link
Member

gsmet commented Dec 11, 2023

Rebasing CI as the failures are not related.

This comment has been minimized.

Copy link

quarkus-bot bot commented Dec 12, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@mkouba mkouba merged commit 7918883 into quarkusio:main Dec 12, 2023
49 checks passed
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Dec 12, 2023
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) area/vertx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants